package com.gc.client.util;

import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Properties;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.plaf.FontUIResource;

public class ThemeManager {
	public static void initLookAndFeel() {
		try {
			Properties props = new Properties();
			props.put("macStyleWindowDecoration", "on");
			com.jtattoo.plaf.acryl.AcrylLookAndFeel.setCurrentTheme(props);
			UIManager.setLookAndFeel(
			        ch.randelshofer.quaqua.QuaquaManager.getLookAndFeel()
			    );
//			 UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel");
//			UIManager.setLookAndFeel("com.jtattoo.plaf.aluminium.AluminiumLookAndFeel");
		} catch (UnsupportedLookAndFeelException e) {
			e.printStackTrace();
		}
	}
	
	public static void setFontSize(int size) {
	    int fontSize = size;
	    Hashtable defaults = UIManager.getDefaults();
	    Enumeration keys = defaults.keys();
	    while (keys.hasMoreElements()) {
	        Object key = keys.nextElement();

	        if ((key instanceof String) && (((String) key).endsWith(".font"))) {
	            FontUIResource font = (FontUIResource) UIManager.get(key);
	            defaults.put (key, new FontUIResource(font.getFontName(), font.getStyle(), fontSize));
	        }
	    }
	 }
}
